package ${package}.${moduleName}.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.github.pagehelper.PageHelper;
import com.kingxunlian.scf.domain.common.PageParameter;



@Service("${classname}Service")
public class ${className}Service implements I${className}Service {

	@Autowired
	private ${className}Dao ${classname}Dao;
	
	@Override
	public ${className}Dto queryByPrimaryKey(${pk.attrType} ${pk.attrname}){
		return ${classname}Dao.queryByPrimaryKey(${pk.attrname});
	}
	
	@Override
	public List<${className}Dto> queryByCondition(${className}Dto ${classname}Dto){
		return ${classname}Dao.queryByCondition(${classname}Dto);
	}

    @Override
    public Page<${className}Dto> queryByPage(${className}Dto ${classname}Dto , PageParameter pageParameter){
        Page<${className}Dto> page = PageHelper.startPage(pageParameter.getCurrentPage(),pageParameter.getPageSize());

         ${classname}Dao.queryByCondition(${classname}Dto);

         return page;
	}

	
	@Override
	public void insert(${className}Dto ${classname}Dto){
		${classname}Dao.insert(${classname}Dto);
	}
	
	@Override
	public void insertSelective(${className}Dto ${classname}Dto){
		${classname}Dao.insertSelective(${classname}Dto);
	}

    @Override
    public void update(${className}Dto ${classname}Dto){
		${classname}Dao.update(${classname}Dto);
    }

    @Override
    public void updateSelective(${className}Dto ${classname}Dto){
		${classname}Dao.updateSelective(${classname}Dto);
	}


    @Override
	public void deleteByPrimaryKey(${pk.attrType} ${pk.attrname}){
		${classname}Dao.deleteByPrimaryKey(${pk.attrname});
	}

    @Override
    public void deleteBatchByPrimaryKey(List<${pk.attrType}> ${pk.attrname}List) {
		${classname}Dao.deleteBatchByPrimaryKey(${pk.attrname}List);
    }
	
}
